package com.linln.modules.ticket.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.linln.common.utils.DateUtil;
import lombok.Data;


/**
 * @author : pengliang
 * @version V1.0
 * @Project: timo
 * @Package com.linln.modules.ticket.domain
 * @Descriptio /**
 * @Project: timo
 * @Package com.linln.modules.ticket.domain
 * @Description: TODO
 * @date Date : 2020年11月23日 17:21
 */

@Data
@TableName(value = "tbl_ticket_log")
public class TicketLog {
    @TableId(value = "ticket_log_id", type = IdType.UUID)
    private String ticketLogId;

    /**
     * 服务券id
     */
    @TableField(value = "ticket_id")
    private String ticketId;
    /**
     * 服务类型名称
     */
    @TableField(value = "service_type_name",exist = false)
    private String serviceTypeName;
    /**
     * 店铺序号
     */
    @TableField(value = "shop_id")
    private String shopId;

    /**
     * 操作人序号
     */
    @TableField(value = "oper_user_id")
    private String operUserId;

//    @TableField(exist = false)
//    private String verificationMoney;

    //金额
    @TableField(value = "verification_money")
    private Double verificationMoney;
    //积分
    @TableField(value = "verification_integral")
    private Integer verificationIntegral;
    /**
     * 核销时间
     */
    @TableField(value = "verification_date")
    @JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
    private Date verificationDate;

    //序列化这个方法
    @JsonGetter("verificationTime")
    public String getVerificationTime() {
        return DateUtil.formatDate(verificationDate);
    }

    /**
     * 核销车牌
     */
    @TableField(value = "license_plate")
    private String licensePlate;

    @TableField(value = "verification_picture")
    private String verificationPicture;

    public static final String COL_TICKET_LOG_ID = "ticket_log_id";

    public static final String COL_TICKET_ID = "ticket_id";

    public static final String COL_SHOP_ID = "shop_id";

    public static final String COL_OPER_USER_ID = "oper_user_id";

    public static final String COL_VERIFICATION_DATE = "verification_date";
}
